🎖️GitЯра🎖️
Commit 6c32af9a84bb53677a21c62ec275aef9beb82e1e
Parents : b4105e3
Author : James Rich <2199651+jamesarich@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-07-28T16:11:42-05:00
Committer : GitHub <noreply@github.com>
Date : 2026-07-28T21:11:42Z
test: revive 80 dormant tests in eight abstract Common*Test classes (#6501)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Changes
15 files changed, 219 insertions(+), 1 deletions(-)
Diff
diff --git a/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonMeshLogRepositoryTest.kt b/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonMeshLogRepositoryTest.kt
index ebd21a17b8..9ebe39bc40 100644
--- a/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonMeshLogRepositoryTest.kt
+++ b/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonMeshLogRepositoryTest.kt
@@ -40,6 +40,7 @@ import org.meshtastic.proto.MeshPacket
import org.meshtastic.proto.PortNum
import org.meshtastic.proto.Telemetry
import kotlin.test.AfterTest
+import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
@@ -57,6 +58,7 @@ abstract class CommonMeshLogRepositoryTest {
private val nowMillis = 1000000000L
+ @BeforeTest
fun setupRepo() {
dbProvider = FakeDatabaseProvider()
meshLogPrefs = FakeMeshLogPrefs()
diff --git a/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonNodeRepositoryTest.kt b/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonNodeRepositoryTest.kt
index 05ffae23d7..ab970249dc 100644
--- a/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonNodeRepositoryTest.kt
+++ b/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonNodeRepositoryTest.kt
@@ -39,6 +39,7 @@ import org.meshtastic.core.di.CoroutineDispatchers
import org.meshtastic.core.model.MeshLog
import org.meshtastic.core.testing.FakeLocalStatsDataSource
import kotlin.test.AfterTest
+import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
@@ -55,6 +56,7 @@ abstract class CommonNodeRepositoryTest {
protected lateinit var repository: NodeRepositoryImpl
+ @BeforeTest
fun setupRepo() {
Dispatchers.setMain(testDispatcher)
lifecycleOwner =
diff --git a/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonPacketRepositoryTest.kt b/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonPacketRepositoryTest.kt
index 34fb6d14cb..689180628b 100644
--- a/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonPacketRepositoryTest.kt
+++ b/core/data/src/commonTest/kotlin/org/meshtastic/core/data/repository/CommonPacketRepositoryTest.kt
@@ -23,6 +23,7 @@ import org.meshtastic.core.di.CoroutineDispatchers
import org.meshtastic.core.model.DataPacket
import org.meshtastic.core.testing.FakeDatabaseProvider
import kotlin.test.AfterTest
+import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
@@ -34,6 +35,7 @@ abstract class CommonPacketRepositoryTest {
protected lateinit var repository: PacketRepositoryImpl
+ @BeforeTest
fun setupRepo() {
dbProvider = FakeDatabaseProvider()
repository = PacketRepositoryImpl(dbProvider, dispatchers)
diff --git a/core/data/src/jvmTest/kotlin/org/meshtastic/core/data/repository/MeshLogRepositoryTest.kt b/core/data/src/jvmTest/kotlin/org/meshtastic/core/data/repository/MeshLogRepositoryTest.kt
new file mode 100644
index 0000000000..bf56fc911e
--- /dev/null
+++ b/core/data/src/jvmTest/kotlin/org/meshtastic/core/data/repository/MeshLogRepositoryTest.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package org.meshtastic.core.data.repository
+
+class MeshLogRepositoryTest : CommonMeshLogRepositoryTest()
diff --git a/core/data/src/jvmTest/kotlin/org/meshtastic/core/data/repository/NodeRepositoryTest.kt b/core/data/src/jvmTest/kotlin/org/meshtastic/core/data/repository/NodeRepositoryTest.kt
new file mode 100644
index 0000000000..dae7c08fa0
--- /dev/null
+++ b/core/data/src/jvmTest/kotlin/org/meshtastic/core/data/repository/NodeRepositoryTest.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package org.meshtastic.core.data.repository
+
+class NodeRepositoryTest : CommonNodeRepositoryTest()
diff --git a/core/data/src/jvmTest/kotlin/org/meshtastic/core/data/repository/PacketRepositoryTest.kt b/core/data/src/jvmTest/kotlin/org/meshtastic/core/data/repository/PacketRepositoryTest.kt
new file mode 100644
index 0000000000..b616f96e56
--- /dev/null
+++ b/core/data/src/jvmTest/kotlin/org/meshtastic/core/data/repository/PacketRepositoryTest.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package org.meshtastic.core.data.repository
+
+class PacketRepositoryTest : CommonPacketRepositoryTest()
diff --git a/core/database/src/androidHostTest/kotlin/org/meshtastic/core/database/dao/DiscoveryDaoTest.kt b/core/database/src/androidHostTest/kotlin/org/meshtastic/core/database/dao/DiscoveryDaoTest.kt
new file mode 100644
index 0000000000..c0d8ba6be8
--- /dev/null
+++ b/core/database/src/androidHostTest/kotlin/org/meshtastic/core/database/dao/DiscoveryDaoTest.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package org.meshtastic.core.database.dao
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import org.junit.runner.RunWith
+import org.robolectric.annotation.Config
+
+@RunWith(AndroidJUnit4::class)
+@Config(sdk = [34])
+class DiscoveryDaoTest : CommonDiscoveryDaoTest()
diff --git a/core/database/src/androidHostTest/kotlin/org/meshtastic/core/database/dao/PacketDaoTest.kt b/core/database/src/androidHostTest/kotlin/org/meshtastic/core/database/dao/PacketDaoTest.kt
new file mode 100644
index 0000000000..53f28072fd
--- /dev/null
+++ b/core/database/src/androidHostTest/kotlin/org/meshtastic/core/database/dao/PacketDaoTest.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package org.meshtastic.core.database.dao
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import org.junit.runner.RunWith
+import org.robolectric.annotation.Config
+
+@RunWith(AndroidJUnit4::class)
+@Config(sdk = [34])
+class PacketDaoTest : CommonPacketDaoTest()
diff --git a/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonDiscoveryDaoTest.kt b/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonDiscoveryDaoTest.kt
index 2315624cd3..119eb11d1e 100644
--- a/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonDiscoveryDaoTest.kt
+++ b/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonDiscoveryDaoTest.kt
@@ -50,6 +50,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun insertSession_returnsAutoGeneratedId() = runTest {
+ createDb()
val session = testSession(timestamp = 1_000_000L)
val id = dao.insertSession(session)
assertTrue(id > 0, "Auto-generated id should be > 0")
@@ -57,6 +58,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getSession_returnsInsertedSession() = runTest {
+ createDb()
val id = dao.insertSession(testSession(timestamp = 2_000_000L, homePreset = "MEDIUM_SLOW"))
val loaded = dao.getSession(id)
assertNotNull(loaded)
@@ -65,10 +67,15 @@ abstract class CommonDiscoveryDaoTest {
assertEquals(2_000_000L, loaded.timestamp)
}
- @Test fun getSession_returnsNullForMissing() = runTest { assertNull(dao.getSession(999L)) }
+ @Test
+ fun getSession_returnsNullForMissing() = runTest {
+ createDb()
+ assertNull(dao.getSession(999L))
+ }
@Test
fun updateSession_modifiesExistingRow() = runTest {
+ createDb()
val id = dao.insertSession(testSession(timestamp = 3_000_000L))
val original = dao.getSession(id)!!
dao.updateSession(original.copy(completionStatus = "stopped", totalUniqueNodes = 5))
@@ -79,6 +86,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun deleteSession_removesRow() = runTest {
+ createDb()
val id = dao.insertSession(testSession())
dao.deleteSession(id)
assertNull(dao.getSession(id))
@@ -90,6 +98,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getInterruptedSession_returnsInProgressSessionForDevice() = runTest {
+ createDb()
dao.insertSession(testSession().copy(deviceAddress = "x:AA:BB:CC:DD:EE:FF", completionStatus = "in_progress"))
val found = dao.getInterruptedSession("x:AA:BB:CC:DD:EE:FF")
assertNotNull(found)
@@ -98,6 +107,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getInterruptedSession_returnsInterruptedSessionToo() = runTest {
+ createDb()
dao.insertSession(testSession().copy(deviceAddress = "x:AA:BB:CC:DD:EE:FF", completionStatus = "interrupted"))
val found = dao.getInterruptedSession("x:AA:BB:CC:DD:EE:FF")
assertNotNull(found)
@@ -106,18 +116,21 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getInterruptedSession_returnsNullForDifferentDevice() = runTest {
+ createDb()
dao.insertSession(testSession().copy(deviceAddress = "x:OTHER-DEVICE", completionStatus = "in_progress"))
assertNull(dao.getInterruptedSession("x:AA:BB:CC:DD:EE:FF"))
}
@Test
fun getInterruptedSession_returnsNullForCompletedSession() = runTest {
+ createDb()
dao.insertSession(testSession().copy(deviceAddress = "x:AA:BB:CC:DD:EE:FF", completionStatus = "complete"))
assertNull(dao.getInterruptedSession("x:AA:BB:CC:DD:EE:FF"))
}
@Test
fun getInterruptedSession_returnsMostRecentWhenMultipleMatch() = runTest {
+ createDb()
dao.insertSession(
testSession(timestamp = 1L).copy(deviceAddress = "x:AA:BB:CC:DD:EE:FF", completionStatus = "interrupted"),
)
@@ -135,6 +148,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getAllSessions_orderedByTimestampDescending() = runTest {
+ createDb()
dao.insertSession(testSession(timestamp = 100L))
dao.insertSession(testSession(timestamp = 300L))
dao.insertSession(testSession(timestamp = 200L))
@@ -151,6 +165,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getPresetResults_returnsResultsForSession() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
dao.insertPresetResult(testPresetResult(sessionId, presetName = "LONG_FAST"))
dao.insertPresetResult(testPresetResult(sessionId, presetName = "SHORT_FAST"))
@@ -162,6 +177,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getPresetResults_doesNotReturnOtherSessionResults() = runTest {
+ createDb()
val session1 = dao.insertSession(testSession(timestamp = 1L))
val session2 = dao.insertSession(testSession(timestamp = 2L))
dao.insertPresetResult(testPresetResult(session1, presetName = "A"))
@@ -173,6 +189,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getPresetResultsFlow_emitsOnInsert() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
val initial = dao.getPresetResultsFlow(sessionId).first()
assertTrue(initial.isEmpty())
@@ -187,6 +204,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getDiscoveredNodes_returnsNodesForPresetResult() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
val presetId = dao.insertPresetResult(testPresetResult(sessionId))
dao.insertDiscoveredNode(testNode(presetId, nodeNum = 100))
@@ -197,6 +215,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun insertDiscoveredNodes_batchInsert() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
val presetId = dao.insertPresetResult(testPresetResult(sessionId))
val batch =
@@ -207,6 +226,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun updateDiscoveredNode_modifiesExistingRow() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
val presetId = dao.insertPresetResult(testPresetResult(sessionId))
val nodeId = dao.insertDiscoveredNode(testNode(presetId, nodeNum = 42))
@@ -223,6 +243,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun deleteSession_cascadesPresetResults() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
dao.insertPresetResult(testPresetResult(sessionId, presetName = "LONG_FAST"))
dao.insertPresetResult(testPresetResult(sessionId, presetName = "SHORT_FAST"))
@@ -232,6 +253,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun deleteSession_cascadesDiscoveredNodes() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
val presetId = dao.insertPresetResult(testPresetResult(sessionId))
dao.insertDiscoveredNode(testNode(presetId, nodeNum = 1))
@@ -242,6 +264,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun deleteSession_doesNotAffectOtherSessions() = runTest {
+ createDb()
val session1 = dao.insertSession(testSession(timestamp = 1L))
val session2 = dao.insertSession(testSession(timestamp = 2L))
val preset1 = dao.insertPresetResult(testPresetResult(session1))
@@ -260,6 +283,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getUniqueNodeCount_countsAcrossPresets() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
val preset1 = dao.insertPresetResult(testPresetResult(sessionId, presetName = "A"))
val preset2 = dao.insertPresetResult(testPresetResult(sessionId, presetName = "B"))
@@ -273,6 +297,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getUniqueNodeNums_returnsDistinctNodeNums() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
val presetId = dao.insertPresetResult(testPresetResult(sessionId))
dao.insertDiscoveredNode(testNode(presetId, nodeNum = 10))
@@ -283,6 +308,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getMaxDistance_returnsLargestDistance() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
val presetId = dao.insertPresetResult(testPresetResult(sessionId))
dao.insertDiscoveredNode(testNode(presetId, nodeNum = 1, distanceFromUser = 500.0))
@@ -293,12 +319,14 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getMaxDistance_returnsNullWhenNoNodes() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
assertNull(dao.getMaxDistance(sessionId))
}
@Test
fun getMaxDistance_returnsNullWhenAllDistancesNull() = runTest {
+ createDb()
val sessionId = dao.insertSession(testSession())
val presetId = dao.insertPresetResult(testPresetResult(sessionId))
dao.insertDiscoveredNode(testNode(presetId, nodeNum = 1, distanceFromUser = null))
@@ -311,6 +339,7 @@ abstract class CommonDiscoveryDaoTest {
@Test
fun getSessionFlow_emitsUpdatesOnChange() = runTest {
+ createDb()
val id = dao.insertSession(testSession(timestamp = 5_000_000L))
val initial = dao.getSessionFlow(id).first()
assertNotNull(initial)
diff --git a/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonPacketDaoTest.kt b/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonPacketDaoTest.kt
index 933dcf6e1b..083c36097e 100644
--- a/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonPacketDaoTest.kt
+++ b/core/database/src/commonTest/kotlin/org/meshtastic/core/database/dao/CommonPacketDaoTest.kt
@@ -97,6 +97,7 @@ abstract class CommonPacketDaoTest {
@Test
fun testGetMessagesFrom() = runTest {
+ createDb()
val contactKey = testContactKeys.first()
val messages = packetDao.getMessagesFrom(contactKey).first()
assertEquals(SAMPLE_SIZE, messages.size)
@@ -106,18 +107,21 @@ abstract class CommonPacketDaoTest {
@Test
fun testGetMessageCount() = runTest {
+ createDb()
val contactKey = testContactKeys.first()
assertEquals(SAMPLE_SIZE, packetDao.getMessageCount(contactKey))
}
@Test
fun testGetUnreadCount() = runTest {
+ createDb()
val contactKey = testContactKeys.first()
assertEquals(SAMPLE_SIZE, packetDao.getUnreadCount(contactKey))
}
@Test
fun testClearUnreadCount() = runTest {
+ createDb()
val contactKey = testContactKeys.first()
packetDao.clearUnreadCount(contactKey, nowMillis + SAMPLE_SIZE)
assertEquals(0, packetDao.getUnreadCount(contactKey))
@@ -125,12 +129,14 @@ abstract class CommonPacketDaoTest {
@Test
fun testClearAllUnreadCounts() = runTest {
+ createDb()
packetDao.clearAllUnreadCounts()
testContactKeys.forEach { assertEquals(0, packetDao.getUnreadCount(it)) }
}
@Test
fun testUpdateMessageStatus() = runTest {
+ createDb()
val contactKey = testContactKeys.first()
val messages = packetDao.getMessagesFrom(contactKey).first()
val packet = messages.first().packet.data
@@ -148,6 +154,7 @@ abstract class CommonPacketDaoTest {
@Test
fun testGetQueuedPackets() = runTest {
+ createDb()
val queuedPacket =
Packet(
uuid = 0L,
@@ -173,6 +180,7 @@ abstract class CommonPacketDaoTest {
@Test
fun testDeleteMessages() = runTest {
+ createDb()
val contactKey = testContactKeys.first()
packetDao.deleteContacts(listOf(contactKey))
assertEquals(0, packetDao.getMessageCount(contactKey))
@@ -180,6 +188,7 @@ abstract class CommonPacketDaoTest {
@Test
fun testGetContactKeys() = runTest {
+ createDb()
val contacts = packetDao.getContactKeys().first()
assertEquals(testContactKeys.size, contacts.size)
testContactKeys.forEach { assertTrue(contacts.containsKey(it)) }
@@ -187,6 +196,7 @@ abstract class CommonPacketDaoTest {
@Test
fun testGetWaypoints() = runTest {
+ createDb()
val waypointPacket =
Packet(
uuid = 0L,
@@ -210,6 +220,7 @@ abstract class CommonPacketDaoTest {
@Test
fun testUpsertReaction() = runTest {
+ createDb()
val reaction =
ReactionEntity(myNodeNum = myNodeNum, replyId = 123, userId = "!test", emoji = "👍", timestamp = nowMillis)
packetDao.insert(reaction)
@@ -217,6 +228,7 @@ abstract class CommonPacketDaoTest {
@Test
fun testGetMessagesFromWithIncludeFiltered() = runTest {
+ createDb()
val contactKey = "filter-test"
val normalMessages = listOf("Msg 1", "Msg 2")
val filteredMessages = listOf("Filtered 1")
@@ -274,6 +286,7 @@ abstract class CommonPacketDaoTest {
@Test
fun testGetPacketsByPacketIdsChunked() = runTest {
+ createDb()
// Regression test for SQLITE_MAX_VARIABLE_NUMBER (999) limit. Inserting >999 packets and
// looking them up by id must not throw; callers are expected to chunk, and each chunk
// must return the correct rows.
diff --git a/feature/firmware/build.gradle.kts b/feature/firmware/build.gradle.kts
index fab7287d0b..85fa8eab2f 100644
--- a/feature/firmware/build.gradle.kts
+++ b/feature/firmware/build.gradle.kts
@@ -52,5 +52,9 @@ kotlin {
}
androidMain.dependencies { implementation(libs.markdown.renderer.android) }
+
+ // performUsbUpdate resolves compose-resources strings, whose desktop implementation needs
+ // the skiko-awt runtime to read the system theme.
+ jvmTest.dependencies { implementation(compose.desktop.currentOs) }
}
}
diff --git a/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/FirmwareRetrieverTest.kt b/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/FirmwareRetrieverTest.kt
new file mode 100644
index 0000000000..18ae94ecad
--- /dev/null
+++ b/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/FirmwareRetrieverTest.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package org.meshtastic.feature.firmware
+
+class FirmwareRetrieverTest : CommonFirmwareRetrieverTest()
diff --git a/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/PerformUsbUpdateTest.kt b/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/PerformUsbUpdateTest.kt
new file mode 100644
index 0000000000..404fe7b44a
--- /dev/null
+++ b/feature/firmware/src/jvmTest/kotlin/org/meshtastic/feature/firmware/PerformUsbUpdateTest.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package org.meshtastic.feature.firmware
+
+class PerformUsbUpdateTest : CommonPerformUsbUpdateTest()
diff --git a/feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/channel/CommonChannelViewModelTest.kt b/feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/channel/CommonChannelViewModelTest.kt
index c295c81c7d..81d60ece32 100644
--- a/feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/channel/CommonChannelViewModelTest.kt
+++ b/feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/channel/CommonChannelViewModelTest.kt
@@ -39,6 +39,7 @@ import org.meshtastic.proto.ChannelSet
import org.meshtastic.proto.Config
import org.meshtastic.proto.LocalConfig
import kotlin.test.AfterTest
+import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
@@ -52,6 +53,7 @@ abstract class CommonChannelViewModelTest {
protected lateinit var viewModel: ChannelViewModel
+ @BeforeTest
fun setupRepo() {
Dispatchers.setMain(testDispatcher)
every { radioConfigRepository.localConfigFlow } returns MutableStateFlow(LocalConfig())
diff --git a/feature/settings/src/jvmTest/kotlin/org/meshtastic/feature/settings/channel/ChannelViewModelTest.kt b/feature/settings/src/jvmTest/kotlin/org/meshtastic/feature/settings/channel/ChannelViewModelTest.kt
new file mode 100644
index 0000000000..6871eaf90b
--- /dev/null
+++ b/feature/settings/src/jvmTest/kotlin/org/meshtastic/feature/settings/channel/ChannelViewModelTest.kt
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2026 Meshtastic LLC
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+package org.meshtastic.feature.settings.channel
+
+class ChannelViewModelTest : CommonChannelViewModelTest()
Served by rngit 1.5.2 - Generated in 0.29s